<template>
  <div class="clearfix inConbox taskscees_box">
    <section class="dipW ju_al secceses_bg_box clearfix">
      <aside class="secceses_bg">
        <img :src="'./static/images/taskSuccess/'+Taskseccess.bg_img+''" alt="">
      </aside>
      <hgroup class="secceses_text">{{Taskseccess.bg_text}}</hgroup>
    </section>
    <section class="dipW ju_al seccess_link clearfix"> 
      <div class="link_box bdr dipW ju_al">
        <span tag="span" @click="addRouter(''+retrunIndex.To+'')" class="link_index bdr">{{retrunIndex.text}}</span>
      </div>
      <div class="link_box bdr dipW ju_al margin_top">
        <span @click="addRouter(''+OrderIndex.To+'')"  class="link_Order bdr">{{OrderIndex.text}}</span>
      </div>
    </section>
  </div>
</template>
<script>
export default {
  data(){
    return {
      Taskseccess:{
        bg_img:'seccessActive.png',
        bg_text:'下单完成，支付成功!!!'
      },
      retrunIndex:{
        To:'/bomNav',
        text:'回到首页'
      },
      OrderIndex:{
        To:'/bomNav/orderAdm',
        text:'查询订单'
      }
    }
  },
  methods:{
    addRouter(route){
      this.$router.push({
        path:route
      })
      this.$router.go(0)
    },
    
  },
  created(){
  
  },
  beforeRouteLeave (to, from, next) {
    if(to.path == '/bomNav/1/Order/OrderDetails/1' || to.path == '/bomNav/1/Order/OrderDetails/2'){
      next({ path: '/bomNav/mall' })
    }else if(to.path == '/bomNav/orderAdm/orderAdmDetilas') {
      next({ path: '/bomNav/orderAdm' })
    }else{
      next();      
    }
  }
}
</script>
<style lang="scss" scoped>
.taskscees_box{
  background: #fff;
  margin-bottom:0;
  position: fixed;
}
.secceses_bg_box{
  width: 100%;
  margin:1.04rem 0rem 1.4rem 0rem;
  .secceses_bg{
    width: 60.6%;
    height: 4.19rem;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .secceses_text{
    width: 100%;
    // height: 0.46rem;
    margin-top:.54rem;
    text-align: center;
    font-size: .34rem;
    color:#666;
    font-weight: 500;
  }
}
.seccess_link{
  width: 100%;
  background: #fff;
  .link_box{
    width: 100%;    
    // width: 32%;
    height: 0.8rem;
    span{
      width: 32%;
      height:100%;
      text-align: center;
      font-weight: 500;
      height: .8rem;
      line-height: .8rem;
      font-size: .34rem;
    }
    .link_index{
      background: #FF7200;
      color:#fff;
    }
    .link_Order{
      background:#fff;
      color:#FF7200;
      border:.02rem solid #FF7200;
    }
  }
  .margin_top{
    margin-top:.42rem;
  }
}
</style>
